package com.apobates.jforum2.troll.actionlog;

import io.seata.spring.annotation.datasource.EnableAutoDataSourceProxy;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;

/**
 * 核心服务: 话题,回复和版块动作操作日志(6)
 * @author xiaofanku
 * @since 20210411
 */
@EnableAutoDataSourceProxy
@SpringBootApplication
@EntityScan(basePackages = {"com.apobates.jforum2.troll.actionlog.entity"})
@EnableDiscoveryClient
public class ActionLogApp {
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        SpringApplication.run(ActionLogApp.class, args);
    }

    @Bean
    @Primary
    public static JpaProperties properties() {
        final JpaProperties jpaProperties = new JpaProperties();
        jpaProperties.setShowSql(true);
        jpaProperties.setDatabasePlatform("org.eclipse.persistence.platform.database.MySQLPlatform");
        return jpaProperties;
    }
}